<?php

$_this =& $this;

/* @var $_this View */
/* @var $form FormHelper */
/* @var $editForm EditFormHelper */
/* @var $html HtmlHelper */
/* @var $ehtml EHtmlHelper */
/* @var $javascript JavascriptHelper */
/* @var $jqax JqaxHelper */
/* @var $filterBlock FilterBlock */

if (count($list->rows)) {

?><table class="table" cellpadding="0"><?php
?><thead><?php
    ?><tr><?php
        ?><th class="nw"><?php
            /*?><?=$this->renderElement('sort_field', array('obj' => $list->order, 'field' => 'name', 'domain' => $po_domain));?><?php*/
            ?><?=__d($po_domain, 'name', true);?><?php
        ?></th><?php
        ?><th class="actions nw"></th><?php
    ?></tr><?php
?></thead><?php
?><tbody><?php

    $i = 0;
    foreach ($list->rows as $item) {
        $class = '';
    	if ($i++ % 2 != 0) {
    		$sep = strlen($class) ? ' ' : '';
    		$class .= $sep.'altrow';
    	}
    	$class = strlen($class) ? ' class="'.$class.'"' : '';

        ?><tr <?=$class;?>><?php
    		?><td class="nw"><?php
                ?><?=$item[$modelName]['name'];?><?php
            ?></td><?php
            ?><td class="actions nw"><?php
                ?><table class="sys_clear" cellpadding="0"><?php
                ?><tr class="sys_clear"><?php
                    ?><?=$ehtml->iconLink("edit", __d(null, $item[$modelName]['__allows']['update'] ? 'change' : 'view', true), "/{$url_part}/{$item[$modelName][$PKName]}/");?><?php
                    $inactive = !($item[$modelName]['__allows']['delete']);
                    $inactive_str = $inactive ? __d(null, 'deny', true) : false;
                    ?><?=$ehtml->iconLink("cancel", __d(null, 'delete', true), "/{$url_part}/{$item[$modelName][$PKName]}/delete", array('inactive' => $inactive_str,), __d($po_domain, 'confirm_del', true)." ".__d(null, "open_q1", true).$item[$modelName]['name'].__d(null, "close_q1", true)."?");?><?php
                ?></tr><?php
                ?></table><?php
            ?></td><?php
    	?></tr><?php
    }

?></tbody><?php
?></table><?php

?><?=$this->renderElement('pagination', array('paging' => $list->pagination));?><?php

} else {
    ?><span class="additional_msg"><?php
        ?><?=__d($po_domain, 'List is empty', true);?><?php
    ?></span><?php
}

?>